﻿<%@ Page Language="C#" MasterPageFile="~/Shared/Masters/List.master" AutoEventWireup="true" Theme ="Default"
    CodeFile="OrgTargetList.aspx.cs" Inherits="Modules_Personal_OrgTargetList" Title="Untitled Page" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register TagPrefix="web" TagName="listtitle" Src="~/Shared/UserControls/ListTitle.ascx" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Assembly="YYControls" Namespace="YYControls" TagPrefix="yyc" %>
<asp:Content ContentPlaceHolderID="idList" ID="idListContent" runat="server">
<script language="javascript" type="text/javascript">
    function selectAll()
    {
        var a = document.getElementsByTagName("input");
        var all = document.getElementById("alls");
        for (var i=0; i<a.length; i++)
        {
            if(all.checked)
            {
                if (a[i].type == "checkbox") 
                {
                    a[i].checked = true;
                }
            }
            else
            {
                if (a[i].type == "checkbox") 
                {
                    a[i].checked = false;
                }
            }
        }
    }
    function cancelAll()
    {
        var a = document.getElementsByTagName("input");
        for (var i=0; i<a.length; i++)
        {
            if (a[i].type == "checkbox") 
            {
                a[i].checked = false;
            }
        }
    }
</script>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="crumb">
        <asp:Label runat="server" ID="lblTitle" Text="单位人员列表"></asp:Label>
    </div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <contenttemplate><div id="divOrgUserListContainer" runat="server">
    <div class="search" id="search">
        <table cellpadding="2" cellspacing="0" class="rtm_shb_b">
            <tr>
                <td style="width: 50px;">
                    <asp:Label runat="server" ID="lblGroupName" Text="单位:"></asp:Label>
                </td>
                <td style="width:125px">
                    <asp:DropDownList ID="ddlSearchOrg" runat="server"></asp:DropDownList>
                </td>
                <td style="width:50px">
                    <asp:Label runat="server" ID="lblPost" Text="岗位："></asp:Label>
                </td>
                <td style="width:125px;">
                    <asp:DropDownList ID="ddlSearchPost" runat="server"></asp:DropDownList>
                </td>
                <td class="rtm_shb_btn" style="white-space: nowrap">
                    <asp:Button ID="btnSearch" runat="server" Text="查询" OnClick="btnSearch_Click"></asp:Button>&nbsp;
                    <asp:Button ID="ResetLinkButton" runat="server" Text="重置" OnClientClick="reset();return false;">
                    </asp:Button>
                </td>
            </tr>
        </table>
    </div>
    <div class="toolbar" id="toolbar">
        <span style="font-weight:bold;height:30px;"><h2>
            <web:listtitle ID="Listtitle1" runat="server" Title="分配审批" /></h2>
        </span>
    </div>
    <yyc:SmartGridView ID="gvOrgUserList" runat="server" AutoGenerateColumns="False" AllowSorting="True" OnSorting="gvOrgUserList_Sorting" OnRowCommand="gvOrgUserList_RowCommand" OnRowDataBound="gvOrgUserList_RowDataBound"
        EmptyDataText="没有找到数据!">
        <FixRowColumn FixRowType="Header,Pager" FixColumns="0,1"></FixRowColumn>

        <Columns>
            <asp:TemplateField HeaderText="操作">
                <itemtemplate>
                    <table width="46px" style="text-align: left">
                        <tr>
                            <td style="border: 0px solid #fff;">
                                <asp:ImageButton runat="server" CommandName="view" _ID='<%# Eval("ID") %>' CommandArgument='<%# Eval("Assign_ID") %>' CausesValidation="False"  ImageUrl="~/Images/icon_srh.gif" ToolTip="查看详细" ID="ibtnView" ></asp:ImageButton>
                            </td>
                        </tr>
                    </table>
                </itemtemplate>
                <controlstyle forecolor="Black" />
                <headerstyle wrap="False" horizontalalign="Center" />
                <itemstyle horizontalalign="Center" forecolor="Black" />
            </asp:TemplateField>
            <asp:BoundField DataField="Name" HeaderText="人员" SortExpression="Name" />
            <asp:BoundField DataField="Org_ID" HeaderText="单位" SortExpression="Org_ID" />
            <asp:BoundField DataField="Post_ID" HeaderText="岗位" SortExpression="Post_ID" />
            <asp:BoundField DataField="Assign_ID" HeaderText="指标套" SortExpression="Assign_ID" />
            <asp:BoundField DataField="Assign_ID" HeaderText="分配时间" SortExpression="Assign_ID" />
        </Columns>
        <FixRowColumn FixRowType="Header,Pager" FixColumns="" />
    </yyc:SmartGridView>
    <webdiyer:AspNetPager ID="AspNetPager" CssClass="aspNetPager" ShowBoxThreshold="1" OnPageChanged="AspNetPager_PageChanged"
        runat="server" HorizontalAlign="Right" PageSize="20" AlwaysShow="True" FirstPageText="首页"
        LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" Width="98%" CustomInfoClass="aspNetPager"
        LayoutType="Div" PageIndexBoxType="TextBox" ShowPageIndexBox="Auto">
    </webdiyer:AspNetPager></div>
     </contenttemplate>
    </asp:UpdatePanel>
    
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <contenttemplate><div id="divUserTargetContainer" runat="server">
        <div class="toolbar" id="divTargetTitle" runat="server">
        <h2>
            <web:listtitle ID="Listtitle2" runat="server" Title="指标列表" />
            ---<asp:Label ID="lblTargetUserName" runat="server" Text=""></asp:Label>
            <asp:HiddenField ID="hdnSelectedAssignID" runat="server" Value="" />
        </h2>
        <asp:LinkButton ID="lbtnBack" runat="server" OnClick="LBtnBack_Click">
            <asp:Label ID="Label2" runat="server" Text="">
                &nbsp;&nbsp;返回</asp:Label>
        </asp:LinkButton>&nbsp;
        <asp:LinkButton ID="lbtnCreate" runat="server" OnClientClick="return openEditor(this, 'add');" OnClick="CreateTarget_Click" >
            <asp:Label ID="Label3" runat="server" Text="">
                &nbsp;&nbsp;新建</asp:Label>
        </asp:LinkButton>
    </div>
            <yyc:SmartGridView ID="gvTargetList" runat="server" AutoGenerateColumns="False" AllowSorting="True" OnSorting="gvTargetList_Sorting" OnRowDataBound="gvTargetList_RowDataBound"
                EmptyDataText="没有找到数据!">
                <FixRowColumn FixRowType="Header,Pager" FixColumns="0,1"></FixRowColumn>

                <Columns>
                    <asp:BoundField DataField="Target_ID" HeaderText="代码"/>
                    <asp:BoundField DataField="Target_ID" HeaderText="名称" />
                    <asp:BoundField DataField="Target_ID" HeaderText="指标类型" />
                    <asp:BoundField DataField="Target_ID" HeaderText="分值"/>
                    <asp:BoundField DataField="Target_ID" HeaderText="是否必选" />
                </Columns>
                <FixRowColumn FixRowType="Header,Pager" FixColumns="" />
            </yyc:SmartGridView></div>
        </contenttemplate>
    </asp:UpdatePanel>
    
<script type="text/javascript">
    function openEditor(_this, action) {
        var url = "OrgTargetAdd.aspx";
        var toId = document.getElementById("ctl00_idList_hdnSelectedAssignID");
        url = url + "?assignId=" + toId.value;
        return default_openEditor(url, _this, action, 450, 200,true);
    } 
</script>
</asp:Content>
